<template>
  <el-date-picker
      v-if="item.domData"
      v-model="localValue"
      v-bind="$attrs"
      :type="item.domType"
      :value-format="item.domFormat"
      :placeholder="item.placeholder"
      @change="handleChange"
  />
  <span v-else>
    {{item.selectDom}}-未开发
  </span>
</template>

<script>
export default {
  name: 'olSelectDom',
  props: {
    modelValue: {
      required: true
    },
    item: {
      required: true
    }
  },
  data() {
    return {
      localValue: this.modelValue
    };
  },
  watch: {
    modelValue(newValue) {
      this.localValue = newValue;
    }
  },
  methods: {
    handleChange(newValue) {
      console.log(newValue,"newss")
      this.localValue = newValue;
      this.$emit('update:modelValue', newValue);
      this.$emit('updateOk', newValue);
    }
  }
};
</script>
